package com.immediatus.util;

import com.immediatus.contracts.IUpdateHandler;

public class UpdateHandlerList extends SmartList<IUpdateHandler> implements IUpdateHandler{

    public UpdateHandlerList(){
    }

    public UpdateHandlerList(final int capacity_){
        super(capacity_);
    }

    @Override
    public void onUpdate(final float secondsElapsed_){
        final int handlerCount = this.size();
        for (int i = handlerCount - 1; i >= 0; i--){
            this.get(i).onUpdate(secondsElapsed_);
        }
    }

    @Override
    public void reset(){
        final int handlerCount = this.size();
        for (int i = handlerCount - 1; i >= 0; i--){
            this.get(i).reset();
        }
    }
}
